using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class PlayerDataPanel : MonoBehaviour
{
    public int gemNum, addGem;
    public int killed, addKill;

    public TextMeshProUGUI gemText, addGemText;
    public TextMeshProUGUI killedText, addKillText;
    public Button confirmBtn;

    private void Awake()
    {
        confirmBtn.onClick.AddListener(ReturnLoginPanel);
    }

    private void OnEnable()
    {
        gemText.text = gemNum.ToString();
        killedText.text = killed.ToString();
        addGemText.text = "+"+addGem.ToString();
        addKillText.text = "+"+addKill.ToString();

    }

    private void OnDestroy()
    {
        confirmBtn.onClick.RemoveListener(ReturnLoginPanel);
    }

    private void ReturnLoginPanel()
    {
        GameController.Instance().Exit();        
    }
    
}
